Skip to content

[FrameworkBundle] Add documentation about using a DSN as the session.handler_id #15560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

[FrameworkBundle] Add documentation about using a DSN as the session.handler_id #15560

wants to merge 2 commits into from

Conversation

Kleinkind
Copy link

The option to provide a DSN as the framework.session.handler_id was introduced in v4.4 but is currently not documented. It was previously mentioned, but the section was removed at some point.
I've reused the config-example from #13227, and added it to both, the framework configuration reference and the page about using a database for session-storage (as the DSN can be used for file- or database-storage).

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that PR!

framework:
session:
# ...
handler_id: 'file://%kernel.project_dir%/var/sessions'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<framework:config>
<framework:session enabled="true" handler-id="file://%kernel.project_dir%/var/sessions"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<framework:session enabled="true" handler-id="file://%kernel.project_dir%/var/sessions"/>
<framework:session enabled="true"
handler-id="file://%kernel.project_dir%/var/sessions"
/>

.. code-block:: php

// config/packages/framework.php
$container->loadFromExtension('framework', [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the container configurator as done in other config blocks.

@@ -11,6 +11,64 @@ across different servers.
Symfony can store sessions in all kinds of databases (relational, NoSQL and
key-value) but recommends key-value databases like Redis to get best performance.

Define Session Storage by DSN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given my comment above this section should not be necessary.

],
]);

Supported DSN protocols are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this part in a .. note:: directive under the first example if this section were to be removed.

@OskarStark OskarStark changed the title [FrameworkBundle] Add documentation about using a DSN as the session.handler_id [FrameworkBundle] Add documentation about using a DSN as the session.handler_id Oct 1, 2022
@OskarStark
Copy link
Contributor

Symfony 4.4 is not supported anymore, you may want to rebase on top of 5.4 branch.

Maybe @alexandre-daubois or @alamirault want to take over?

Thank you

@alexandre-daubois
Copy link
Member

Definitely, I'll take care of this 🙂

javiereguiluz added a commit that referenced this pull request Aug 28, 2023
… the `session.handler_id` (alexandre-daubois)

This PR was merged into the 5.4 branch.

Discussion
----------

[FrameworkBundle] Add documentation about using a DSN as the `session.handler_id`

Rework of #15560

Commits
-------

264ebcc [FrameworkBundle] Add documentation about using a DSN as the `session.handler_id`
@HeahDude
Copy link
Contributor

This one can be closed now that #18767 has been merged.

@OskarStark OskarStark closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants